#ifndef __ULCORE_PREDICTION_H__
#define __ULCORE_PREDICTION_H__

#include "ULCore_Statistic.h"
#include "ULCore_RandomPool.h"

class ULC_Prediction{
protected:
	int initFlag; //Whether random pools are initialized
	ULC_RandomPool redPools[UL_RED_BALLS_COUNT];
	ULC_RandomPool outRedPools[UL_RED_BALLS_COUNT];
	ULC_RandomPool bluePool;
	int SetupRedPools(ULC_Statistic &stat);
	int SetupOutRedPools(ULC_Statistic &stat);
	int SetupBluePool(ULC_Statistic &stat);
public:
	ULC_Prediction();
	ULC_Prediction(ULC_Statistic &stat);
	virtual int ParseStatistic(ULC_Statistic &stat);	
public:
	//Basic prediction
	int PredictNextSerialByRandom(ULC_Serial &serial);
	int PredictNextSerialBySorted(ULC_Serial &serial);
	int PredictNextSerialByOut(ULC_Serial &serial);
	int PredictNextSerialByLatestNSerials(ULC_Serial &serial, int nSerials, ULC_Serial *latestNSerials);
public:
	//Advanced prediction using a better implementation
	virtual int PredictNextSerial(ULC_Serial &serial);
	virtual int PredictNextSerial(ULC_Serial &serial, int nSerials, ULC_Serial *serials);
	virtual int PredictNextSerial(ULC_Serial &serial, ULC_History &historyData);
};

#endif /*__ULCORE_PREDICTION_H__*/
